package com.base.data.account
{
	import com.base.util.Utils;
	
	import mx.collections.ArrayCollection;

	/**
	 * 账号数据
	 * @author Administrator
	 */	
	public class AccountBean
	{
		/**
		 *账号类型 
		 */		
		[Bindable]
		public static var AccountTypeList:ArrayCollection = new ArrayCollection([
			{label:"58同城",data:1}
			,{label:"株洲在线",data:2}
			,{label:"赶集网",data:3}
		
		]);
		
		private var _type:int;
		
		private var _userName:String;
		
		private var _password:String;
		
		/**
		 * 账号数据
		 * @param type
		 * @param userName
		 * @param password
		 */		
		public function AccountBean( )
		{
		}

		public function get password():String
		{
			return _password;
		}

		public function set password(value:String):void
		{
			_password = value;
		}

		public function get userName():String
		{
			return _userName;
		}

		public function set userName(value:String):void
		{
			_userName = value;
		}

		public function get type():int
		{
			return _type;
		}

		public function set type(value:int):void
		{
			var item:Object = Utils.findDataByArray( AccountTypeList , value );
			if( !item ) {
				throw new Error("请输入正确的账号类型");
				return;
			}
			_type = value;
		}
		
	}
}